<%@page import="com.zhuoshi.bean.ManagerRoleBean"%>
<%@page import="com.zhuoshi.dao.ManagerRoleDao"%>
<%@page import="com.zhuoshi.bean.ProvinceBean"%>
<%@page import="com.zhuoshi.dao.ProvinceDao"%>
<%@page import="com.zhuoshi.bean.AreaBean"%>
<%@page import="com.zhuoshi.dao.AreaDao"%>
<%@page import="com.zhuoshi.bean.ManagerBean"%>
<%@page import="com.zhuoshi.dao.ManagerDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

	ManagerDao dao = new ManagerDao();
	List<ManagerBean> list = dao.getList(null);
	pageContext.setAttribute("list", list);
	
	
	//取出所有area
	AreaDao areaDao = new AreaDao();
	List<AreaBean> areaList = areaDao.getList();
	pageContext.setAttribute("areaList", areaList);
	//取出所有province
	ProvinceDao provinceDao = new ProvinceDao();
	List<ProvinceBean> provinceList = provinceDao.getList();
	pageContext.setAttribute("provinceList", provinceList);
	//取出所有的角色  role
	ManagerRoleDao roleDao = new ManagerRoleDao();
	List<ManagerRoleBean> roleList = roleDao.getList();
	pageContext.setAttribute("roleList", roleList);
%>

<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="template/H-ui.min.css">
    <link rel="stylesheet" type="text/css" href="template/H-ui.admin.css">
    <link rel="stylesheet" type="text/css" href="template/iconfont.css">
    <link rel="stylesheet" type="text/css" href="template/icheck.css">
    <link rel="stylesheet" type="text/css" href="template/skin.css" id="skin">
    <link rel="stylesheet" type="text/css" href="template/style.css">
    <!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>人员管理</title>
    <link rel="stylesheet" href="template/layer.css" id="layui_layer_skinlayercss">
    <link href="template/WdatePicker.css" rel="stylesheet" type="text/css">
</head>

<body>



    <form name="form2" action="http://localhost:8080/EMIS/deluser" method="post" id="form2">
        <input type="hidden" name="id" id="id">
    </form>



    <nav class="breadcrumb"><i class="Hui-iconfont"></i> 首页 <span class="c-gray en">&gt;</span> 系统管理 <span class="c-gray en">&gt;</span>人员管理
    </nav>

    <div class="page-container">

        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l"> <a class="btn btn-primary radius" onClick="system_category_add('添加人员','user_add.jsp')" href="javascript:;"><i class="Hui-iconfont"></i> 添加人员</a></span>
        </div>

        <div class="mt-20">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper no-footer">
                <table class="table table-border table-bordered table-hover table-bg table-sort dataTable no-footer" id="DataTables_Table_0" role="grid" aria-describedby="DataTables_Table_0_info">
                    <thead>
                        <tr class="text-c" role="row">
                            <th width="80" class="sorting_disabled" rowspan="1" colspan="1" aria-label="用户名" style="width: 80px;">用户名</th>
                            <th class="sorting_desc" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-sort="descending" aria-label="密码: 升序排列" style="width: 44px;">密码</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="姓名: 升序排列" style="width: 58px;">姓名</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="性别: 升序排列" style="width: 44px;">性别</th>
                            <th class="sorting_disabled" rowspan="1" colspan="1" aria-label="岗位" style="width: 160px;">岗位</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="电话: 升序排列" style="width: 116px;">电话</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="邮箱: 升序排列" style="width: 207px;">邮箱</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="区域: 升序排列" style="width: 44px;">区域</th>
                            <th class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="省份: 升序排列" style="width: 45px;">省份</th>
                            <th width="100" class="sorting" tabindex="0" aria-controls="DataTables_Table_0" rowspan="1" colspan="1" aria-label="操作: 升序排列" style="width: 100px;">操作</th>
                        </tr>
                    </thead>
                    <tbody>























	<c:forEach var="bean" items="${list }">
	
                        <tr class="text-c odd" role="row">

                            <td>${bean.username }</td>
                            <td class="sorting_1"><%-- ${bean.password } --%>***</td>

                            <td>${bean.realname }</td>
                            <td>${bean.gender }</td>
                            <td>
                            <c:forEach items="${roleList }" var="roleBean">
                            <c:if test="${roleBean.id == bean.role_id }">
                            ${roleBean.role_name }
                            </c:if>
                            </c:forEach>
                            </td>
                            <td>${bean.telphone }</td>
                            <td>${bean.email }</td>
                            <td>
                            <c:forEach items="${areaList }" var="areaBean">
                            <c:if test="${areaBean.id == bean.area }">
                            ${areaBean.areaname }
                            </c:if>
                            </c:forEach>
                            
                            
                            </td>
                            <td>
                            <c:forEach items="${provinceList }" var="provinceBean">
                            <c:if test="${provinceBean.id == bean.province }">
                            ${provinceBean.province }
                            </c:if>
                            </c:forEach>
                            </td>

                            <td class="f-14">
                                <a title="编辑" href="javascript:;" onClick="system_category_edit(&#39;修改人员&#39;,&#39;user_update.jsp?id=${bean.id}&#39;,&#39;1&#39;,&#39;800&#39;,&#39;480&#39;)" style="text-decoration:none"><i class="Hui-iconfont"></i></a>

                                <!--<a title="删除" href="javascript:;" onclick="system_user_del(this,'1')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>-->
                                <a title="删除" href="user_del.jsp?id=${bean.id}" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont"></i></a>

                            </td>

                        </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <footer class="footer mt-20">
        <div class="container">
            Copyright © 本后台系统由KEG提供技术支持
        </div>
    </footer>
    <script type="text/javascript" src="template/jquery.min.js"></script>
    <script type="text/javascript" src="template/layer.js"></script>
    <script type="text/javascript" src="template/laypage.js"></script>
    <script type="text/javascript" src="template/WdatePicker.js"></script>
    <script type="text/javascript" src="template/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="template/H-ui.js"></script><a href="javascript:void(0)" class="Hui-iconfont toTop" title="返回顶部" alt="返回顶部" style="display:none"></a>
    <script type="text/javascript" src="template/H-ui.admin.js"></script>
    <script type="text/javascript">
        $('.table-sort').dataTable({
            "aaSorting": [
                [1, "desc"]
            ], //默认第几个排序
            "bStateSave": true, //状态保存
            "aoColumnDefs": [
                //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
                {
                    "orderable": false,
                    "aTargets": [0, 4]
                } // 制定列不参与排序
            ]
        });
        /*系统-栏目-添加*/
        function system_category_add(title, url, w, h) {
            layer_show(title, url, w, h);
        }
        /*系统-栏目-编辑*/
        function system_category_edit(title, url, id, w, h) {
            layer_show(title, url, w, h);
        }

        function system_user_del(title, url, id, w, h) {
            layer_show(title, url, w, h);
        }
        /*系统-栏目-删除*/
        /*function system_user_del(obj,id){
        	layer.confirm('确认要删除吗？',function(index){
        		$(obj).parents("tr").remove();

        		
        		//document.getElementById("id").value = id;
        		//document.form2.submit();

        		document.getElementById("id").value = id;
        		document.form2.submit();

        		layer.msg('已删除!',{icon:1,time:1000});
        	});
        }*/
    </script>

</body>

</html>